﻿using iCodeStudio.Entity;
using iCodeStudio.Services;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace iCodeStudio.Tests
{
    [TestClass]
    public class UserTest
    {
        
        [TestMethod]
        public void GetAllUser() 
        {
             iCode_UserServices service = new iCode_UserServices();
            IList<iCode_User> userList = service.GetAlliCode_User();
        }

        [TestMethod]
        public void AddUser() 
        {
            iCode_UserServices service = new iCode_UserServices();
            iCode_User user = new iCode_User()
            {
                iCode_User_Account = "admin",
                iCode_User_Pwd = "111111",
                iCode_User_Name = "管理员"
            };
            service.AddUser(user);
        }

        [TestMethod]
        public void UpdateUser() 
        {
            iCode_UserServices service = new iCode_UserServices();
            iCode_User user = service.GetUserByid(1);
            user.iCode_User_Name = "管理员";
            service.UpdateUser(user);
        }


    }
}
